
<?php
    
    echo $form->create('User', array('action' => 'login'));
    if (isset($closeModalbox) && $closeModalbox) 
        echo "<div id='closeModalbox'></div>";

    if ($ajax->isAjax()) 
    {
    
    	echo $ajax->form('login', 'user', array(
    		'model'    => 'User',
    		'url'      => array( 'controller' => 'users', 'action' => 'login'),
    		'update'   => 'MB_content',
    		'complete' => 'closeModalbox()'
    	));
    } 
    else
    {
    	echo $form->create('User', array('action' => 'login'));
    }   
  
?>

<table id='tables' cellspacing="5"  id="login">
<tr>
<td colspan="2" style="color: #FF8080; font-weight: bold;background: #E4E4E4; line-height: 25px;" align="center"><?php if ($session->check('Message.auth')) echo $this->Session->flash('auth');?></td>
</tr>
  <tr>
    <td align="right"><b>Tài khoản:</b></td>
    <td><?php echo $this->Form->input('username',array('label' =>'')); ?></td>
  </tr>
  <tr>
    <td align="right"><b>Mật khẩu:</b></td>
    <td><?php  echo $this->Form->input('password',array('label' =>'')); ?></td>
  </tr>
  <tr>
    <td></td>
    <td>Ghi nhớ đăng nhập |<?php echo $this->Html->link(__('Quên mật khẩu', true), array('controller'=>'users','action' => 'forgot'));?></td>
  </tr>
  <tr>
    <td></td>
    <td>Chưa có tài khoản, <?php echo $this->Html->link(__('Đăng ký', true), array('controller'=>'users','action' => 'dangky'));?></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><?php  echo $form->end('Đăng nhập');?>&nbsp;</td>
  </tr>
</table>

